package member_coupon

import (
	// "bp/cache"
	sqlc "bp/db/sqlc"
	// "bp/internal/util"
	"context"
)

// RefreshMemberCouponGotStatParam 刷新会员券领取统计参数
type RefreshMemberCouponGotStatParam struct {
	MemberCouponPtr *sqlc.MemberCoupon
	MemberID        int64
}

// RefreshMemberCouponGotStat 刷新会员券领取统计
func (s *MemberCouponEntityServiceImp) RefreshMemberCouponGotStat(ctx context.Context, q *sqlc.Queries, ptr *sqlc.MemberCoupon) (err error) {
	// slog := util.NewContextLogger(ctx, s.slog)

	err = q.UpsertMemberCouponGotStat(ctx, sqlc.UpsertMemberCouponGotStatParams{
		BrandID:   ptr.BrandID,
		OwnerType: ptr.OwnerType,
		OwnerID:   ptr.OwnerID,
		MemberID:  ptr.MemberID,
		CouponID:  ptr.CouponID,
	})
	return
}
